package reflect;

import reflect.annotations.AutoRunClass;

/**
 * @Classname: ReflectDemo8
 * @Author: bromide
 * @CreateTime: 2022/4/19--10:12
 * @Version: V1.0
 * @Description: 反射机制中查看注解
 */
public class ReflectDemo8 {
    public static void main(String[] args) throws Exception {
        Class cls = Class.forName("reflect.Person");
        boolean b = cls.isAnnotationPresent(AutoRunClass.class);
        if (b) {
            System.out.println(cls.getName() + ":被注解@AutoRunClass标注了！");
        } else {
            System.out.println(cls.getName() + ":没有被注解@AutoRunClass标注！");
        }
    }
}
